from django.shortcuts import render,HttpResponse

# Create your views here.



import time
def timer(request):
    ctime = time.time()
    return render(request,'timer.html',{'date':ctime})



def special_case_2003(request):

    return HttpResponse("special_case_2003")



def year_archive(request,year):

    return HttpResponse(year)


def month_archive(request,y,m):
    return HttpResponse(y + '-' + m)

def login(request):

    if request.method=='GET':
        return render(request, 'login.html')
    else: # 否则是post请求
        print(request.POST)

        user = request.POST.get('user')
        pwd = request.POST.get('pwd')
        if user =='mfw' and pwd =='123':
            return HttpResponse('登录成功！')
        else:
            return  HttpResponse("用户名或密码错误！")




